package oj;

public class Num83 {

    public ListNode deleteDuplicates(ListNode head) {
        ListNode dummyHead = new ListNode(101);
        dummyHead.next = head;
        ListNode prev = dummyHead;
        ListNode node = prev.next;

        while(node != null){
            if(prev.val != node.val){
                prev = prev.next;
            }else{
                prev.next = node.next;
            }
            node = node.next;
        }
        return dummyHead.next;
    }





}
